<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddOrganizationIdToFsCompnayTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('fs_company', function (Blueprint $table) {
            $table->tinyInteger('organizationId')->default(0)->comment('fs_organizations.id')->after('id');
        });

        \App\Models\Common\FsCompanyModel::query()->update(['organizationId' => 1]);
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('fs_company', function (Blueprint $table) {
            $table->dropColumn('organizationId');
        });
    }
}
